import { createVNode, render } from "vue";

// 定义为异步组件，减少初始加载时的包体积
const AsyncDialog = defineAsyncComponent(() => import("./FuncDialog.vue"));

const div = document.createElement("div");
document.body.appendChild(div);

export default (pos: { top: number; left: number } = { top: 0, left: 0 }) => {
  render(null, div);

  const dialog = createVNode(AsyncDialog, {
    pos,
  });
  render(dialog, div);
};
